//
//  QLMAddDeviceMidCell.m
//  Xiaomakuaixiu
//
//  Created by 龚碧容 on 2017/10/13.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "QLMAddDeviceMidCell.h"

@implementation QLMAddDeviceMidCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (IBAction)addressBookBtnAction:(UIButton *)sender {
    [_delegate contactAddressBookAction];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *identifiew=@"QLMAddDeviceMidCellId";
    QLMAddDeviceMidCell *cell=[tableView dequeueReusableCellWithIdentifier:identifiew];
    if (cell==nil) {
        cell=[[[NSBundle mainBundle] loadNibNamed:@"QLMAddDeviceMidCell" owner:nil options:nil] firstObject];
        
        UIView *line1=[[UIView alloc] initWithFrame:CGRectMake(20, 49.5, kScreen_width-20-80, 0.5)];
        line1.backgroundColor=[UIColor lightGrayColor];
        [cell addSubview:line1];
        
        NSArray *titlArr=[NSArray arrayWithObjects:@"机主 *",@"电话 *",nil];
        for (int i=0; i<2; i++) {
            UILabel *aTipLabel=[[UILabel alloc] initWithFrame:CGRectMake(20, 10+50*i, 60, 30)];
            aTipLabel.font=[UIFont systemFontOfSize:16];
            aTipLabel.textColor=[UIColor darkGrayColor];
            
            NSString *telStr=[NSString stringWithFormat:@"%@",titlArr[i]];
            NSMutableAttributedString *aString=[[NSMutableAttributedString alloc] initWithString:telStr];
            [aString addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(2, telStr.length-2)];
            aTipLabel.attributedText=aString;
            
            aTipLabel.backgroundColor=[UIColor clearColor];
            aTipLabel.textAlignment=NSTextAlignmentLeft;
            [cell addSubview:aTipLabel];
        }
    }
    return cell;
}

@end
